package com.wanli.storemobile.homepage.model;

import android.util.Log;

import com.google.gson.Gson;
import com.wanli.storemobile.MyApplication;
import com.wanli.storemobile.appconst.MethodType;
import com.wanli.storemobile.appconst.URLConst;
import com.wanli.storemobile.base.DataCallBack;
import com.wanli.storemobile.bean.AreaListBean;
import com.wanli.storemobile.bean.BankAuthCodeBean;
import com.wanli.storemobile.bean.BankCardBean;
import com.wanli.storemobile.bean.BankDeposiAddressListBean;
import com.wanli.storemobile.bean.BankInfoBean;
import com.wanli.storemobile.bean.BankListBean;
import com.wanli.storemobile.bean.BaseResponseBean;
import com.wanli.storemobile.bean.BatchAddProductBean;
import com.wanli.storemobile.bean.BatchInStorageBean;
import com.wanli.storemobile.bean.BranchBrankListBean;
import com.wanli.storemobile.bean.ChannelTypeBean;
import com.wanli.storemobile.bean.CreateOrderBean;
import com.wanli.storemobile.bean.DeviceImgListBean;
import com.wanli.storemobile.bean.DeviceListBean;
import com.wanli.storemobile.bean.GetWxMercIdBean;
import com.wanli.storemobile.bean.HuaBeiOrderBean;
import com.wanli.storemobile.bean.IdCardBean;
import com.wanli.storemobile.bean.ImageBean;
import com.wanli.storemobile.bean.EBankIndustryListBean;
import com.wanli.storemobile.bean.IndustryListBean;
import com.wanli.storemobile.bean.KDBAllIndustryListBean;
import com.wanli.storemobile.bean.LicenseInfoBean;
import com.wanli.storemobile.bean.LoginBean;
import com.wanli.storemobile.bean.MemberListBean;
import com.wanli.storemobile.bean.MerchantDetailsBean;
import com.wanli.storemobile.bean.MerchantIndustryNumberBean;
import com.wanli.storemobile.bean.OrderFeeBean;
import com.wanli.storemobile.bean.OrderListBean;
import com.wanli.storemobile.bean.ProductClassifyListBean;
import com.wanli.storemobile.bean.ProductListBean;
import com.wanli.storemobile.bean.PurchaseBean;
import com.wanli.storemobile.bean.PurchaseDetailsBean;
import com.wanli.storemobile.bean.PurchaseListBean;
import com.wanli.storemobile.bean.RechargeConfigBean;
import com.wanli.storemobile.bean.RechargeListBean;
import com.wanli.storemobile.bean.SettlementInfoBean;
import com.wanli.storemobile.bean.SignContractBean;
import com.wanli.storemobile.bean.StoreDeatilsBean;
import com.wanli.storemobile.bean.StoreListBean;
import com.wanli.storemobile.bean.StoreReceivedBean;
import com.wanli.storemobile.bean.SubBranchListBean;
import com.wanli.storemobile.bean.VersionBean;
import com.wanli.storemobile.retorfit_manager.ResponseObserver;
import com.wanli.storemobile.retorfit_manager.RetrofitHelper;
import com.wanli.storemobile.utils.ToastUtil;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class HomePageModelImpl implements IHomePageModel {


    @Override
    public void requestStoreOrderIndex(int page, String pay_status, String start_time, String end_time, String start_minute, String end_minute, DataCallBack<OrderListBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("page", page);
        params.put("limit", 50);
        params.put("pay_status", pay_status);
        params.put("start_time", start_time);
        params.put("end_time", end_time);
        params.put("start_minute", start_minute);
        params.put("end_minute", end_minute);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.StoreOrderIndex, params, new ResponseObserver<OrderListBean>() {
            @Override
            public void onSuccessful(OrderListBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(OrderListBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestStoreReceived(String start_date, String end_date, DataCallBack<StoreReceivedBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("start_date", start_date);
        params.put("end_date", end_date);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.storeReceived, params, new ResponseObserver<StoreReceivedBean>() {
            @Override
            public void onSuccessful(StoreReceivedBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(StoreReceivedBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestGoodsBatchAdd(List<BatchAddProductBean> itemList, DataCallBack<BaseResponseBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("itemList", new Gson().toJson(itemList));
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.StoreGoodsbatchAdd, params, new ResponseObserver<BaseResponseBean>() {
            @Override
            public void onSuccessful(BaseResponseBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BaseResponseBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestGoodsInStorage(List<BatchInStorageBean> itemList, DataCallBack<BaseResponseBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("itemList", new Gson().toJson(itemList));
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.StoreGoodsInStorage, params, new ResponseObserver<BaseResponseBean>() {
            @Override
            public void onSuccessful(BaseResponseBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BaseResponseBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestGoodsIndex(int page, String status, String store_goods_category_id, DataCallBack<ProductListBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("page", page);
        params.put("status", status);
        params.put("store_goods_category_id", store_goods_category_id);
        params.put("limit", -1);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.StoreGoodsIndex, params, new ResponseObserver<ProductListBean>() {
            @Override
            public void onSuccessful(ProductListBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(ProductListBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestDeviceUnifyIndex(int page, String type, DataCallBack<DeviceListBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("page", page);
        params.put("type", type);
        params.put("limit", 50);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.DeviceUnifyIndex, params, new ResponseObserver<DeviceListBean>() {
            @Override
            public void onSuccessful(DeviceListBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(DeviceListBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestStoreOrderAdd(String pay_category_id, String order_fee, String auth_code, String goods_list, DataCallBack<CreateOrderBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("pay_category_id", pay_category_id);
        params.put("order_fee", order_fee);
        params.put("auth_code", auth_code);
        params.put("goods_list", goods_list);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.StoreOrderAdd, params, new ResponseObserver<CreateOrderBean>() {
            @Override
            public void onSuccessful(CreateOrderBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(CreateOrderBean bean, String msg, String code) {
                callBack.onFailed(msg, code);
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestStoreOrderScanCode(String pay_category_id, String order_fee, String auth_code, String goods_list, String order_no, DataCallBack<BaseResponseBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("pay_category_id", pay_category_id);
        params.put("order_fee", order_fee);
        params.put("auth_code", auth_code);
        params.put("goods_list", goods_list);
        params.put("order_no", order_no);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.StoreOrderScanCode, params, new ResponseObserver<BaseResponseBean>() {
            @Override
            public void onSuccessful(BaseResponseBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BaseResponseBean bean, String msg, String code) {
                callBack.onFailed(msg, code);
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestStoreOrderShow(String order_no, DataCallBack<CreateOrderBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("order_no", order_no);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.StoreOrderShow, params, new ResponseObserver<CreateOrderBean>() {
            @Override
            public void onSuccessful(CreateOrderBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(CreateOrderBean bean, String msg, String code) {
                callBack.onFailed(msg, code);
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestStoreGoodsCategoryAdd(String name, String serial_number, DataCallBack<BaseResponseBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("name", name);
        params.put("serial_number", serial_number);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.StoreGoodsCategoryAdd, params, new ResponseObserver<BaseResponseBean>() {
            @Override
            public void onSuccessful(BaseResponseBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BaseResponseBean bean, String msg, String code) {
                callBack.onFailed(msg, code);
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestStoreGoodsCategoryEdit(String id, String name, String serial_number, DataCallBack<BaseResponseBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("id", id);
        params.put("name", name);
        params.put("serial_number", serial_number);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.StoreGoodsCategoryUpdate, params, new ResponseObserver<BaseResponseBean>() {
            @Override
            public void onSuccessful(BaseResponseBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BaseResponseBean bean, String msg, String code) {
                callBack.onFailed(msg, code);
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestOrderFeeCount(DataCallBack<OrderFeeBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.StoreOrderFeeCount, params, new ResponseObserver<OrderFeeBean>() {
            @Override
            public void onSuccessful(OrderFeeBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(OrderFeeBean bean, String msg, String code) {
                callBack.onFailed(msg, code);
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestProductClassify(DataCallBack<ProductClassifyListBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("limit", -1);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.StoreGoodsCategoryIndex, params, new ResponseObserver<ProductClassifyListBean>() {
            @Override
            public void onSuccessful(ProductClassifyListBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(ProductClassifyListBean bean, String msg, String code) {
                callBack.onFailed(msg, code);
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestProductClassifyDelete(String id, DataCallBack<BaseResponseBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("id", id);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.StoreGoodsCategoryDelete, params, new ResponseObserver<BaseResponseBean>() {
            @Override
            public void onSuccessful(BaseResponseBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BaseResponseBean bean, String msg, String code) {
                callBack.onFailed(msg, code);
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestUploadFile(String dir_name, String file, DataCallBack<ImageBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("dir_name", dir_name);
        params.put("file", "data:image/png;base64," + file);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.UploadFile, params, new ResponseObserver<ImageBean>() {
            @Override
            public void onSuccessful(ImageBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(ImageBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestStoreGoodsDelete(String id, DataCallBack<BaseResponseBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("id", id);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.StoreGoodsDelete, params, new ResponseObserver<BaseResponseBean>() {
            @Override
            public void onSuccessful(BaseResponseBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BaseResponseBean bean, String msg, String code) {
                callBack.onFailed(msg, code);
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestbindDeviceId(String client_no, DataCallBack<BaseResponseBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("client_no", client_no);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.bindDeviceId, params, new ResponseObserver<BaseResponseBean>() {
            @Override
            public void onSuccessful(BaseResponseBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BaseResponseBean bean, String msg, String code) {
                callBack.onFailed(msg, code);
            }
        });
    }

    @Override
    public void requestUnBindDeviceId(String client_no, DataCallBack<BaseResponseBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("client_no", client_no);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.unBindDeviceId, params, new ResponseObserver<BaseResponseBean>() {
            @Override
            public void onSuccessful(BaseResponseBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BaseResponseBean bean, String msg, String code) {
                callBack.onFailed(msg, code);
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestStoreGoodsEdit(String id, String name, String code, String store_goods_category_id, String price, String thumb, DataCallBack<BaseResponseBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("id", id);
        params.put("name", name);
        params.put("code", code);
        params.put("store_goods_category_id", store_goods_category_id);
        params.put("price", price);
        params.put("thumb", thumb);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.StoreGoodsUpdate, params, new ResponseObserver<BaseResponseBean>() {
            @Override
            public void onSuccessful(BaseResponseBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BaseResponseBean bean, String msg, String code) {
                callBack.onFailed(msg, code);
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestVerifyBankFourFactor(String bank_name, String settle_name, String settle_mobile, String id_card, String card_no, DataCallBack<BankAuthCodeBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("name", settle_name);
        params.put("bank_name", bank_name);
        params.put("bank_mobile", settle_mobile);
        params.put("id_card_no", id_card);
        params.put("bank_card_no", card_no);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.SetBankInfo, params, new ResponseObserver<BankAuthCodeBean>() {
            @Override
            public void onSuccessful(BankAuthCodeBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BankAuthCodeBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestUpAmount(String id, String sms_code, String valid_date, DataCallBack<BaseResponseBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("id", id);
        params.put("sms_code", sms_code);
        params.put("valid_date", valid_date);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.upAmount, params, new ResponseObserver<BankAuthCodeBean>() {
            @Override
            public void onSuccessful(BankAuthCodeBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BankAuthCodeBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestBankInfo(DataCallBack<BankInfoBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.GetBankInfo, params, new ResponseObserver<BankInfoBean>() {
            @Override
            public void onSuccessful(BankInfoBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BankInfoBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestAddHuaBeiOrder(String order_fee, DataCallBack<HuaBeiOrderBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("order_fee", order_fee);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.AddHuaBeiOrder, params, new ResponseObserver<HuaBeiOrderBean>() {
            @Override
            public void onSuccessful(HuaBeiOrderBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(HuaBeiOrderBean bean, String msg, String code) {
                callBack.onFailed(msg, code);
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestDeviceImg(String type, DataCallBack<DeviceImgListBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("type", type);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.GetDeviceImg, params, new ResponseObserver<DeviceImgListBean>() {
            @Override
            public void onSuccessful(DeviceImgListBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(DeviceImgListBean bean, String msg, String code) {
                callBack.onFailed(msg, code);
                ToastUtil.showShort(msg);
            }
        });
    }


    @Override
    public void requestEBankStoreSaveProfile(String store_no, String merchant_type, String merchant_name, String license_no,
                                             String license_full_name, String license_address, String license_start, String license_end, String license_pic,
                                             String province, String city, String area, String address, String lng, String lat, String contact_name,
                                             String legal_name, String legal_id_card_no,
                                             String legal_id_card_start, String legal_id_card_end, String bank,
                                             String branch, String branch_province, String branch_city,
                                             String bank_card_no, String holder_mobile, String unionpay,
                                             String door_pic, String bank_card_front_pic,
                                             String legal_id_card_front_pic, String legal_id_card_back_pic,
                                             String legal_id_card_hand_pic,
                                             String inside_pic, String cashier_desk_pic, String sign_pic, String mcc_code, DataCallBack<BaseResponseBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("store_no", store_no == null ? "" : store_no);
        params.put("merchant_type", merchant_type == null ? "" : merchant_type);
        params.put("merchant_name", merchant_name == null ? "" : merchant_name);
        params.put("contact_name", contact_name == null ? "" : contact_name);
        params.put("license_no", license_no == null ? "" : license_no);
        params.put("license_full_name", license_full_name == null ? "" : license_full_name);
        params.put("license_address", license_address == null ? "" : license_address);
        params.put("license_start", license_start == null ? "" : license_start);
        params.put("license_end", license_end == null ? "" : license_end);
        params.put("license_pic", license_pic == null ? "" : license_pic);
        params.put("inside_pic", inside_pic == null ? "" : inside_pic);
        params.put("cashier_desk_pic", cashier_desk_pic == null ? "" : cashier_desk_pic);
        params.put("legal_name", legal_name == null ? "" : legal_name);
        params.put("legal_id_card_no", legal_id_card_no == null ? "" : legal_id_card_no);
        params.put("legal_id_card_start", legal_id_card_start == null ? "" : legal_id_card_start);
        params.put("legal_id_card_end", legal_id_card_end == null ? "" : legal_id_card_end);
        params.put("province", province == null ? "" : province);
        params.put("city", city == null ? "" : city);
        params.put("area", area == null ? "" : area);
        params.put("address", address == null ? "" : address);
        params.put("bank", bank == null ? "" : bank);
        params.put("branch", branch == null ? "" : branch);
        params.put("branch_province", branch_province == null ? "" : branch_province);
        params.put("branch_city", branch_city == null ? "" : branch_city);
        params.put("holder_mobile", holder_mobile == null ? "" : holder_mobile);
        params.put("bank_card_no", bank_card_no == null ? "" : bank_card_no);
        params.put("door_pic", door_pic == null ? "" : door_pic);
        params.put("bank_card_front_pic", bank_card_front_pic == null ? "" : bank_card_front_pic);
        params.put("legal_id_card_front_pic", legal_id_card_front_pic == null ? "" : legal_id_card_front_pic);
        params.put("legal_id_card_back_pic", legal_id_card_back_pic == null ? "" : legal_id_card_back_pic);
        params.put("legal_id_card_hand_pic", legal_id_card_hand_pic == null ? "" : legal_id_card_hand_pic);
        params.put("mcc_code", mcc_code);
        params.put("unionpay", unionpay == null ? "" : unionpay);
        params.put("account_type", "0");
        params.put("lng", lng == null ? "" : lng);
        params.put("lat", lat == null ? "" : lat);
        params.put("sign_pic", sign_pic == null ? "" : sign_pic);

        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.DianYinSaveProfile, params, new ResponseObserver<BaseResponseBean>() {
            @Override
            public void onSuccessful(BaseResponseBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BaseResponseBean bean, String msg, String code) {
                callBack.onFailed(msg, code);
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestEBankStoreIncomeProfile(String merchant_type, String merchant_name, String license_no, String license_full_name, String license_address, String license_start, String license_end, String license_pic,
                                               String province, String city, String area,
                                               String address, String lng, String lat, String contact_name,
                                               String legal_name,
                                               String legal_id_card_no, String legal_id_card_start,
                                               String legal_id_card_end, String bank, String branch,
                                               String branch_province, String branch_city,
                                               String bank_card_no, String holder_mobile, String unionpay,
                                               String door_pic, String bank_card_front_pic,
                                               String legal_id_card_front_pic, String legal_id_card_back_pic,
                                               String legal_id_card_hand_pic, String inside_pic, String cashier_desk_pic, String sign_pic, String mcc_code,
                                               DataCallBack<BaseResponseBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("merchant_type", merchant_type == null ? "" : merchant_type);
        params.put("merchant_name", merchant_name == null ? "" : merchant_name);
        params.put("contact_name", contact_name == null ? "" : contact_name);
        params.put("license_no", license_no == null ? "" : license_no);
        params.put("license_full_name", license_full_name == null ? "" : license_full_name);
        params.put("license_address", license_address == null ? "" : license_address);
        params.put("license_start", license_start == null ? "" : license_start);
        params.put("license_end", license_end == null ? "" : license_end);
        params.put("license_pic", license_pic == null ? "" : license_pic);
        params.put("inside_pic", inside_pic == null ? "" : inside_pic);
        params.put("cashier_desk_pic", cashier_desk_pic == null ? "" : cashier_desk_pic);
        params.put("legal_name", legal_name == null ? "" : legal_name);
        params.put("legal_id_card_no", legal_id_card_no == null ? "" : legal_id_card_no);
        params.put("legal_id_card_start", legal_id_card_start == null ? "" : legal_id_card_start);
        params.put("legal_id_card_end", legal_id_card_end == null ? "" : legal_id_card_end);
        params.put("province", province == null ? "" : province);
        params.put("city", city == null ? "" : city);
        params.put("area", area == null ? "" : area);
        params.put("address", address == null ? "" : address);
        params.put("bank", bank == null ? "" : bank);
        params.put("branch", branch == null ? "" : branch);
        params.put("branch_province", branch_province == null ? "" : branch_province);
        params.put("branch_city", branch_city == null ? "" : branch_city);
        params.put("holder_mobile", holder_mobile == null ? "" : holder_mobile);
        params.put("bank_card_no", bank_card_no == null ? "" : bank_card_no);
        params.put("door_pic", door_pic == null ? "" : door_pic);
        params.put("bank_card_front_pic", bank_card_front_pic == null ? "" : bank_card_front_pic);
        params.put("legal_id_card_front_pic", legal_id_card_front_pic == null ? "" : legal_id_card_front_pic);
        params.put("legal_id_card_back_pic", legal_id_card_back_pic == null ? "" : legal_id_card_back_pic);
        params.put("legal_id_card_hand_pic", legal_id_card_hand_pic == null ? "" : legal_id_card_hand_pic);
        params.put("mcc_code", mcc_code);
        params.put("unionpay", unionpay == null ? "" : unionpay);
        params.put("account_type", "0");
        params.put("lng", lng == null ? "" : lng);
        params.put("lat", lat == null ? "" : lat);
        params.put("sign_pic", sign_pic == null ? "" : sign_pic);

        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.DianYinIncomeProfile, params, new ResponseObserver<BaseResponseBean>() {
            @Override
            public void onSuccessful(BaseResponseBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BaseResponseBean bean, String msg, String code) {
                callBack.onFailed(msg, code);
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestGetProvince(DataCallBack<AreaListBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.GetProvince, params, new ResponseObserver<AreaListBean>() {
            @Override
            public void onSuccessful(AreaListBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(AreaListBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestGetCity(int province_code, DataCallBack<AreaListBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("province_code", province_code);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.GetCity, params, new ResponseObserver<AreaListBean>() {
            @Override
            public void onSuccessful(AreaListBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(AreaListBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestGetArea(int city_code, DataCallBack<AreaListBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("city_code", city_code);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.GetArea, params, new ResponseObserver<AreaListBean>() {
            @Override
            public void onSuccessful(AreaListBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(AreaListBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestGetBankName(String bank_name, DataCallBack<AreaListBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("bank_name", bank_name == null ? "" : bank_name);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.GetBankName, params, new ResponseObserver<AreaListBean>() {
            @Override
            public void onSuccessful(AreaListBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(AreaListBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestGetBranchBankName(int page, String key, String bank_name, String province_name, String city_name, DataCallBack<BranchBrankListBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("page", page);
        params.put("limit", 50);
        params.put("key", key);
        params.put("bank_name", bank_name == null ? "" : bank_name);
        params.put("province_name", province_name == null ? "" : province_name);
        params.put("city_name", city_name == null ? "" : city_name);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.GetBankCode, params, new ResponseObserver<BranchBrankListBean>() {
            @Override
            public void onSuccessful(BranchBrankListBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BranchBrankListBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestAliIdCard(String file_path, String side, DataCallBack<IdCardBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("file_path", file_path);
        params.put("side", side);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.ALIIDCARD, params, new ResponseObserver<IdCardBean>() {
            @Override
            public void onSuccessful(IdCardBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(IdCardBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestAliLicenseInfo(String file_path, DataCallBack<LicenseInfoBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("file_path", file_path);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.ALILICENSEINFO, params, new ResponseObserver<LicenseInfoBean>() {
            @Override
            public void onSuccessful(LicenseInfoBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(LicenseInfoBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestAliBankCard(String file_path, DataCallBack<BankCardBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("file_path", file_path);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.ALIBANKCARD, params, new ResponseObserver<BankCardBean>() {
            @Override
            public void onSuccessful(BankCardBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BankCardBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestChangeStlInfo(String account_type, String bank_card_front_pic, String bank_card_back_pic, String yinsheng_change_pic, String holder, String holder_mobile, String holder_id_card_no, String branch_province, String branch_city, String bank, String bank_type, String branch, String bank_card_no, String unionpay, DataCallBack<BaseResponseBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("account_type", account_type);
        params.put("bank_card_front_pic", bank_card_front_pic);//结算银行卡正面照
        params.put("bank_card_back_pic", bank_card_back_pic);//结算银行卡背面面照
        params.put("yinsheng_change_pic", yinsheng_change_pic);//信息变更申请表图片
        params.put("holder", holder);//开户人姓名
        params.put("holder_mobile", holder_mobile);//开户支行银联号
        params.put("holder_id_card_no", holder_id_card_no);
        params.put("branch_province", branch_province);//开户行省
        params.put("branch_city", branch_city);//开户行市
        params.put("bank", bank);//总行名称
        params.put("bank_type", bank_type);//开户行行别编号
        params.put("branch", branch);//开户支行银联号
        params.put("bank_card_no", bank_card_no);//结算卡号
        params.put("unionpay", unionpay);//开户支行银联号

        Log.e("请求参数",new Gson().toJson(params));
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.ChangeStlInfo, params, new ResponseObserver<BaseResponseBean>() {
            @Override
            public void onSuccessful(BaseResponseBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BaseResponseBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestGetStlInfo(DataCallBack<SettlementInfoBean> callBack) {
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.GetStlInfo, null, new ResponseObserver<SettlementInfoBean>() {
            @Override
            public void onSuccessful(SettlementInfoBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(SettlementInfoBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestStoreProfile(DataCallBack<StoreDeatilsBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.StoreProfile, params, new ResponseObserver<StoreDeatilsBean>() {
            @Override
            public void onSuccessful(StoreDeatilsBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(StoreDeatilsBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestIncomeToQuickSub(String name, String mcc_code, String door_pic, DataCallBack<BaseResponseBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("name", name);
        params.put("mcc_code", mcc_code);
        params.put("door_pic", door_pic);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.incomeToQuickSub, params, new ResponseObserver<BaseResponseBean>() {
            @Override
            public void onSuccessful(BaseResponseBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BaseResponseBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestStoreIndex(DataCallBack<StoreListBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("page", 1);
        params.put("limit", 50);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.StoreIndex, params, new ResponseObserver<StoreListBean>() {
            @Override
            public void onSuccessful(StoreListBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(StoreListBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestChangeBindStore(String no, String bind_store_no, DataCallBack<BaseResponseBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("no", no);
        params.put("bind_store_no", bind_store_no);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.changeBindStore, params, new ResponseObserver<BaseResponseBean>() {
            @Override
            public void onSuccessful(BaseResponseBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BaseResponseBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestChangeStore(String store_no, DataCallBack<LoginBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("store_no", store_no);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.changeStore, params, new ResponseObserver<LoginBean>() {
            @Override
            public void onSuccessful(LoginBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(LoginBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestSaveNewStatus(String message_no, DataCallBack<BaseResponseBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("message_no", message_no);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.saveNewStatus, params, new ResponseObserver<BaseResponseBean>() {
            @Override
            public void onSuccessful(BaseResponseBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BaseResponseBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestqrurlBindStore(String qrurl, DataCallBack<BaseResponseBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("qrurl", qrurl);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.qrurlBindStore, params, new ResponseObserver<BaseResponseBean>() {
            @Override
            public void onSuccessful(BaseResponseBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BaseResponseBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestClientVersion(DataCallBack<VersionBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("oem_no", MyApplication.getOem_no());
        params.put("app_type", "Store");
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.clientVersion, params, new ResponseObserver<VersionBean>() {
            @Override
            public void onSuccessful(VersionBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(VersionBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestMerchantReceived(String start_date, String end_date, DataCallBack<StoreReceivedBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("start_date", start_date);
        params.put("end_date", end_date);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.merchantReceived, params, new ResponseObserver<StoreReceivedBean>() {
            @Override
            public void onSuccessful(StoreReceivedBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(StoreReceivedBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestMerchantRechargeConfig(DataCallBack<RechargeConfigBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.MerchantGetRechargeConfig, params, new ResponseObserver<RechargeConfigBean>() {
            @Override
            public void onSuccessful(RechargeConfigBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(RechargeConfigBean bean, String msg, String code) {
                callBack.onFailed(msg, code);
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestMerchantSaveRechargeConfig(List<RechargeConfigBean.DataBean> list, DataCallBack<BaseResponseBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("list", new Gson().toJson(list));
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.MerchantSaveRechargeConfig, params, new ResponseObserver<BaseResponseBean>() {
            @Override
            public void onSuccessful(BaseResponseBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BaseResponseBean bean, String msg, String code) {
                callBack.onFailed(msg, code);
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestMerchantRechargeList(int page, DataCallBack<RechargeListBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("page", page);
        params.put("limit", 50);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.MerchantMemberRechargeIndex, params, new ResponseObserver<RechargeListBean>() {
            @Override
            public void onSuccessful(RechargeListBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(RechargeListBean bean, String msg, String code) {
                callBack.onFailed(msg, code);
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestMerchantOrderFeeCount(DataCallBack<OrderFeeBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.merchantOrderFeeCount, params, new ResponseObserver<OrderFeeBean>() {
            @Override
            public void onSuccessful(OrderFeeBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(OrderFeeBean bean, String msg, String code) {
                callBack.onFailed(msg, code);
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestMerchantOrderIndex(int page, String pay_status, String start_time, String end_time, String start_minute, String end_minute, DataCallBack<OrderListBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("page", page);
        params.put("limit", 50);
        params.put("pay_status", pay_status);
        params.put("start_time", start_time);
        params.put("end_time", end_time);
        params.put("start_minute", start_minute);
        params.put("end_minute", end_minute);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.merchantOrderIndex, params, new ResponseObserver<OrderListBean>() {
            @Override
            public void onSuccessful(OrderListBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(OrderListBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestMerchantStoreIndex(int page, DataCallBack<StoreListBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("page", page);
        params.put("limit", 50);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.merchantStoreIndex, params, new ResponseObserver<StoreListBean>() {
            @Override
            public void onSuccessful(StoreListBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(StoreListBean bean, String msg, String code) {
                callBack.onFailed(msg, code);
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestMerchantMemberIndex(int page, String mobile, DataCallBack<MemberListBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("page", page);
        params.put("limit", 50);
        params.put("mobile", mobile);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.merchantMemberIndex, params, new ResponseObserver<MemberListBean>() {
            @Override
            public void onSuccessful(MemberListBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(MemberListBean bean, String msg, String code) {
                callBack.onFailed(msg, code);
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestMerchantMemberDelete(String member_no, DataCallBack<BaseResponseBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("member_no", member_no);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.merchantMemberDelete, params, new ResponseObserver<BaseResponseBean>() {
            @Override
            public void onSuccessful(BaseResponseBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BaseResponseBean bean, String msg, String code) {
                callBack.onFailed(msg, code);
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestMerchantMemberUpdate(String member_no, String name, String mobile, String money, DataCallBack<BaseResponseBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("member_no", member_no);
        params.put("name", name);
        params.put("money", money);
        params.put("mobile", mobile);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.merchantMemberUpdate, params, new ResponseObserver<BaseResponseBean>() {
            @Override
            public void onSuccessful(BaseResponseBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BaseResponseBean bean, String msg, String code) {
                callBack.onFailed(msg, code);
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestIndustryType(String mcc_type, DataCallBack<EBankIndustryListBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("mcc_type", mcc_type);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.getMcc, params, new ResponseObserver<EBankIndustryListBean>() {
            @Override
            public void onSuccessful(EBankIndustryListBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(EBankIndustryListBean bean, String msg, String code) {
                callBack.onFailed(msg, code);
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestStorePurchaseAdd(String purchaser, String order_fee, List<PurchaseBean> goods_list, DataCallBack<BaseResponseBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("purchaser", purchaser);
        params.put("order_fee", order_fee);
        params.put("goods_list", new Gson().toJson(goods_list));
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.StorePurchaseAdd, params, new ResponseObserver<BaseResponseBean>() {
            @Override
            public void onSuccessful(BaseResponseBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BaseResponseBean bean, String msg, String code) {
                callBack.onFailed(msg, code);
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestStorePurchaseIndex(int page, String start_time, String end_time, DataCallBack<PurchaseListBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("page", page);
        params.put("limit", 50);
        params.put("start_date", start_time);
        params.put("end_date", end_time);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.StorePurchaseIndex, params, new ResponseObserver<PurchaseListBean>() {
            @Override
            public void onSuccessful(PurchaseListBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(PurchaseListBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestStorePurchaseDelete(String order_no, DataCallBack<BaseResponseBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("order_no", order_no);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.StorePurchaseDelete, params, new ResponseObserver<BaseResponseBean>() {
            @Override
            public void onSuccessful(BaseResponseBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BaseResponseBean bean, String msg, String code) {
                callBack.onFailed(msg, code);
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestStorePurchaseShow(String order_no, DataCallBack<PurchaseDetailsBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("order_no", order_no);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.StorePurchaseShow, params, new ResponseObserver<PurchaseDetailsBean>() {
            @Override
            public void onSuccessful(PurchaseDetailsBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(PurchaseDetailsBean bean, String msg, String code) {
                callBack.onFailed(msg, code);
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestGetRegion(int code, int level, DataCallBack<BankDeposiAddressListBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("code", code);
        params.put("level", level);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.getRegion, params, new ResponseObserver<BankDeposiAddressListBean>() {
            @Override
            public void onSuccessful(BankDeposiAddressListBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BankDeposiAddressListBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }

        });
    }

    @Override
    public void requesGetOpenBank(String bank_type, String city_code, DataCallBack<SubBranchListBean> callBack) {

        Map<String, Object> params = new HashMap<>();
        params.put("bank_type", bank_type);
        params.put("city_code", city_code);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.getOpenBank, params, new ResponseObserver<SubBranchListBean>() {
            @Override
            public void onSuccessful(SubBranchListBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(SubBranchListBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }

        });
    }

    @Override
    public void requestGetBank(String bank_name, DataCallBack<BankListBean> callBack) {

        Map<String, Object> params = new HashMap<>();
        params.put("bank_name", bank_name == null ? "" : bank_name);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.getBank, params, new ResponseObserver<BankListBean>() {
            @Override
            public void onSuccessful(BankListBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BankListBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }

        });
    }

    @Override
    public void requestKDBIndustryType(DataCallBack<KDBAllIndustryListBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.findAnyBusiness, params, new ResponseObserver<KDBAllIndustryListBean>() {
            @Override
            public void onSuccessful(KDBAllIndustryListBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(KDBAllIndustryListBean bean, String msg, String code) {
                callBack.onFailed(msg, code);
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestGetMcc(DataCallBack<MerchantIndustryNumberBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.storeGetMcc, params, new ResponseObserver<MerchantIndustryNumberBean>() {
            @Override
            public void onSuccessful(MerchantIndustryNumberBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(MerchantIndustryNumberBean bean, String msg, String code) {
                callBack.onFailed(msg, code);
                ToastUtil.showShort(msg);
            }
        });
    }

    @Override
    public void requestIndustryIndex(DataCallBack<IndustryListBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("page", 1);
        params.put("limit", 50);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.IndustryIndex, params, new ResponseObserver<IndustryListBean>() {
            @Override
            public void onSuccessful(IndustryListBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(IndustryListBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }


    @Override
    public void requestStoreSaveProfile(String store_no, int quick_income, String merchant_type, String merchant_name, String user_wx, String contact_name, String legal_name,
                                        String contact_mobile, String legal_id_card_no, String legal_id_card_start,
                                        String legal_id_card_end, String province, String city, String area, String address, String lng,
                                        String lat, String license_no, String license_full_name, String license_address,
                                        String license_start, String license_end, String shop_type, String settle_to, String industry_id,
                                        String rate, String legal_flag, String unincorporated_id, String unincorporated_name, String account_type, String branch, String holder,
                                        String holder_id_card_no, String holder_mobile, String bank_card_no, String door_pic,
                                        String inside_pic, String cashier_desk_pic, String license_pic, String bank_card_front_pic,
                                        String legal_id_card_front_pic, String legal_id_card_back_pic, String legal_id_card_hand_pic,
                                        String non_leg_settle_auth_pic, String non_leg_idcard_front_pic, String non_leg_idcard_back_pic,
                                        String terminal_type, String collect_pic, String collect_pic_two, String merchant_register_pic, String settlement_cycle,
                                        String reg_capital, String kdb_province_id, String kdb_city_id, String kdb_area_id, String kdb_bank_code, int crp_profession, int crp_gender, String legal_mobile, String email, String bank, String bank_card_back_pic, String unionpay, String bank_type, String branch_province, String branch_city, String open_acc_area, String bank_account_permit_pic, String channel_type, String mcc_cd,String qr_code_data,
                                        DataCallBack<BaseResponseBean> callBack) {

        Map<String, Object> params = new HashMap<>();
        params.put("store_no", store_no == null ? "" : store_no);
        params.put("quick_income", quick_income);
        params.put("merchant_type", merchant_type == null ? "" : merchant_type);
        params.put("merchant_name", merchant_name == null ? "" : merchant_name);
        params.put("user_wx", user_wx == null ? "" : user_wx);
        params.put("contact_name", contact_name == null ? "" : contact_name);
        params.put("legal_name", legal_name == null ? "" : legal_name);
        params.put("contact_mobile", contact_mobile == null ? "" : contact_mobile);
        params.put("legal_id_card_no", legal_id_card_no == null ? "" : legal_id_card_no);
        params.put("legal_id_card_start", legal_id_card_start == null ? "" : legal_id_card_start);
        params.put("legal_id_card_end", legal_id_card_end == null ? "" : legal_id_card_end);
        params.put("province", province == null ? "" : province);
        params.put("city", city == null ? "" : city);
        params.put("area", area == null ? "" : area);
        params.put("address", address == null ? "" : address);
        params.put("lng", lng == null ? "" : lng);
        params.put("lat", lat == null ? "" : lat);
        params.put("license_no", license_no == null ? "" : license_no);
        params.put("license_full_name", license_full_name == null ? "" : license_full_name);
        params.put("license_address", license_address == null ? "" : license_address);
        params.put("license_start", license_start == null ? "" : license_start);
        params.put("license_end", license_end == null ? "" : license_end);
        params.put("shop_type", shop_type == null ? "" : shop_type);
        params.put("settle_to", settle_to == null ? "" : settle_to);
        params.put("industry_id", industry_id == null ? "" : industry_id);
        params.put("rate", rate == null ? "" : rate);
        params.put("legal_flag", legal_flag);
        params.put("unincorporated_id", unincorporated_id);
        params.put("unincorporated_name", unincorporated_name);
        params.put("account_type", account_type == null ? "" : account_type);
        params.put("branch", branch == null ? "" : branch);
        params.put("holder", holder == null ? "" : holder);
        params.put("holder_id_card_no", holder_id_card_no == null ? "" : holder_id_card_no);
        params.put("holder_mobile", holder_mobile == null ? "" : holder_mobile);
        params.put("bank_card_no", bank_card_no == null ? "" : bank_card_no);
        params.put("door_pic", door_pic == null ? "" : door_pic);
        params.put("inside_pic", inside_pic == null ? "" : inside_pic);
        params.put("cashier_desk_pic", cashier_desk_pic == null ? "" : cashier_desk_pic);
        params.put("license_pic", license_pic == null ? "" : license_pic);
        params.put("bank_card_front_pic", bank_card_front_pic == null ? "" : bank_card_front_pic);
        params.put("legal_id_card_front_pic", legal_id_card_front_pic == null ? "" : legal_id_card_front_pic);
        params.put("legal_id_card_back_pic", legal_id_card_back_pic == null ? "" : legal_id_card_back_pic);
        params.put("legal_id_card_hand_pic", legal_id_card_hand_pic == null ? "" : legal_id_card_hand_pic);
        params.put("non_leg_settle_auth_pic", non_leg_settle_auth_pic == null ? "" : non_leg_settle_auth_pic);
        params.put("non_leg_idcard_front_pic", non_leg_idcard_front_pic == null ? "" : non_leg_idcard_front_pic);
        params.put("non_leg_idcard_back_pic", non_leg_idcard_back_pic == null ? "" : non_leg_idcard_back_pic);
        params.put("terminal_type", terminal_type == null ? "" : terminal_type);
        params.put("collect_pic", collect_pic == null ? "" : collect_pic);
        params.put("collect_pic_two", collect_pic_two == null ? "" : collect_pic_two);
        params.put("merchant_register_pic", merchant_register_pic == null ? "" : merchant_register_pic);
        params.put("mcc_code", mcc_cd);
        params.put("crp_profession", crp_profession);
        params.put("crp_gender", crp_gender);
        params.put("legal_mobile", legal_mobile == null ? "" : legal_mobile);
        params.put("email", email == null ? "" : email);
        params.put("unionpay", unionpay == null ? "" : unionpay);
        params.put("bank_card_back_pic", bank_card_back_pic == null ? "" : bank_card_back_pic);
        params.put("settlement_cycle", settlement_cycle == null ? "" : settlement_cycle);
        params.put("reg_capital", reg_capital == null ? "" : reg_capital);
        params.put("kdb_province_id", kdb_province_id == null ? "" : kdb_province_id);
        params.put("kdb_city_id", kdb_city_id == null ? "" : kdb_city_id);
        params.put("kdb_area_id", kdb_area_id == null ? "" : kdb_area_id);
        params.put("kdb_bank_code", kdb_bank_code == null ? "" : kdb_bank_code);
        params.put("bank", bank == null ? "" : bank);
        params.put("bank_type", bank_type == null ? "" : bank_type);
        params.put("branch_province", branch_province == null ? "" : branch_province);
        params.put("branch_city", branch_city == null ? "" : branch_city);
        params.put("open_acc_area", open_acc_area == null ? "" : open_acc_area);
        params.put("bank_account_permit_pic", bank_account_permit_pic == null ? "" : bank_account_permit_pic);
        params.put("channel_type", channel_type == null ? "" : channel_type);
        params.put("mcc_cd", mcc_cd == null ? "" : mcc_cd);
        params.put("qr_code_data", qr_code_data == null ? "" : qr_code_data);

        String s = new Gson().toJson(params);
        Log.e("保存门店资料", s);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.saveProfile, params, new ResponseObserver<BaseResponseBean>() {
            @Override
            public void onSuccessful(BaseResponseBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BaseResponseBean bean, String msg, String code) {
                callBack.onFailed(msg, code);
                ToastUtil.showShort(msg);
            }
        });

    }

    @Override
    public void requestStoreIncomeProfile(String merchant_id, int quick_income, String merchant_type, String merchant_name, String user_wx, String contact_name, String legal_name,
                                          String contact_mobile, String password, String legal_id_card_no, String legal_id_card_start,
                                          String legal_id_card_end, String province, String city, String area, String address, String lng,
                                          String lat, String license_no, String license_full_name, String license_address,
                                          String license_start, String license_end, String shop_type, String settle_to, String industry_id,
                                          String rate, String legal_flag, String unincorporated_id, String unincorporated_name, String account_type, String branch, String holder,
                                          String holder_id_card_no, String holder_mobile, String bank_card_no, String door_pic,
                                          String inside_pic, String cashier_desk_pic, String license_pic, String bank_card_front_pic,
                                          String legal_id_card_front_pic, String legal_id_card_back_pic, String legal_id_card_hand_pic,
                                          String non_leg_settle_auth_pic, String non_leg_idcard_front_pic, String non_leg_idcard_back_pic,
                                          String terminal_type, String collect_pic, String collect_pic_two, String merchant_register_pic, String settlement_cycle,
                                          String reg_capital, String kdb_province_id, String kdb_city_id, String kdb_area_id, String kdb_bank_code, int crp_profession, int crp_gender, String legal_mobile, String email, String bank, String bank_card_back_pic, String unionpay, String bank_type, String branch_province, String branch_city, String open_acc_area, String bank_account_permit_pic, String channel_type, String mcc_cd,String qr_code_data,
                                          DataCallBack<BaseResponseBean> callBack) {

        Map<String, Object> params = new HashMap<>();
        params.put("merchant_id", merchant_id == null ? "" : merchant_id);
        params.put("quick_income", quick_income);
        params.put("merchant_type", merchant_type == null ? "" : merchant_type);
        params.put("merchant_name", merchant_name == null ? "" : merchant_name);
        params.put("user_wx", user_wx == null ? "" : user_wx);
        params.put("contact_name", contact_name == null ? "" : contact_name);
        params.put("legal_name", legal_name == null ? "" : legal_name);
        params.put("contact_mobile", contact_mobile == null ? "" : contact_mobile);
        params.put("password", password == null ? "" : password);
        params.put("legal_id_card_no", legal_id_card_no == null ? "" : legal_id_card_no);
        params.put("legal_id_card_start", legal_id_card_start == null ? "" : legal_id_card_start);
        params.put("legal_id_card_end", legal_id_card_end == null ? "" : legal_id_card_end);
        params.put("province", province == null ? "" : province);
        params.put("city", city == null ? "" : city);
        params.put("area", area == null ? "" : area);
        params.put("address", address == null ? "" : address);
        params.put("lng", lng == null ? "" : lng);
        params.put("lat", lat == null ? "" : lat);
        params.put("license_no", license_no == null ? "" : license_no);
        params.put("license_full_name", license_full_name == null ? "" : license_full_name);
        params.put("license_address", license_address == null ? "" : license_address);
        params.put("license_start", license_start == null ? "" : license_start);
        params.put("license_end", license_end == null ? "" : license_end);
        params.put("shop_type", shop_type == null ? "" : shop_type);
        params.put("settle_to", settle_to == null ? "" : settle_to);
        params.put("industry_id", industry_id == null ? "" : industry_id);
        params.put("rate", rate == null ? "" : rate);
        params.put("legal_flag", legal_flag);
        params.put("unincorporated_id", unincorporated_id);
        params.put("unincorporated_name", unincorporated_name);
        params.put("account_type", account_type == null ? "" : account_type);
        params.put("branch", branch == null ? "" : branch);
        params.put("holder", holder == null ? "" : holder);
        params.put("holder_id_card_no", holder_id_card_no == null ? "" : holder_id_card_no);
        params.put("holder_mobile", holder_mobile == null ? "" : holder_mobile);
        params.put("bank_card_no", bank_card_no == null ? "" : bank_card_no);
        params.put("door_pic", door_pic == null ? "" : door_pic);
        params.put("inside_pic", inside_pic == null ? "" : inside_pic);
        params.put("cashier_desk_pic", cashier_desk_pic == null ? "" : cashier_desk_pic);
        params.put("license_pic", license_pic == null ? "" : license_pic);
        params.put("bank_card_front_pic", bank_card_front_pic == null ? "" : bank_card_front_pic);
        params.put("legal_id_card_front_pic", legal_id_card_front_pic == null ? "" : legal_id_card_front_pic);
        params.put("legal_id_card_back_pic", legal_id_card_back_pic == null ? "" : legal_id_card_back_pic);
        params.put("legal_id_card_hand_pic", legal_id_card_hand_pic == null ? "" : legal_id_card_hand_pic);
        params.put("non_leg_settle_auth_pic", non_leg_settle_auth_pic == null ? "" : non_leg_settle_auth_pic);
        params.put("non_leg_idcard_front_pic", non_leg_idcard_front_pic == null ? "" : non_leg_idcard_front_pic);
        params.put("non_leg_idcard_back_pic", non_leg_idcard_back_pic == null ? "" : non_leg_idcard_back_pic);
        params.put("terminal_type", terminal_type == null ? "" : terminal_type);
        params.put("collect_pic", collect_pic == null ? "" : collect_pic);
        params.put("collect_pic_two", collect_pic_two == null ? "" : collect_pic_two);
        params.put("merchant_register_pic", merchant_register_pic == null ? "" : merchant_register_pic);
        params.put("mcc_code", mcc_cd);
        params.put("crp_profession", crp_profession);
        params.put("crp_gender", crp_gender);
        params.put("legal_mobile", legal_mobile == null ? "" : legal_mobile);
        params.put("email", email == null ? "" : email);
        params.put("unionpay", unionpay == null ? "" : unionpay);
        params.put("bank_card_back_pic", bank_card_back_pic == null ? "" : bank_card_back_pic);
        params.put("settlement_cycle", settlement_cycle == null ? "" : settlement_cycle);
        params.put("reg_capital", reg_capital == null ? "" : reg_capital);
        params.put("kdb_province_id", kdb_province_id == null ? "" : kdb_province_id);
        params.put("kdb_city_id", kdb_city_id == null ? "" : kdb_city_id);
        params.put("kdb_area_id", kdb_area_id == null ? "" : kdb_area_id);
        params.put("kdb_bank_code", kdb_bank_code == null ? "" : kdb_bank_code);
        params.put("bank", bank == null ? "" : bank);
        params.put("bank_type", bank_type == null ? "" : bank_type);
        params.put("branch_province", branch_province == null ? "" : branch_province);
        params.put("branch_city", branch_city == null ? "" : branch_city);
        params.put("open_acc_area", open_acc_area == null ? "" : open_acc_area);
        params.put("bank_account_permit_pic", bank_account_permit_pic == null ? "" : bank_account_permit_pic);
        params.put("channel_type", channel_type == null ? "" : channel_type);
        params.put("mcc_cd", mcc_cd == null ? "" : mcc_cd);
        params.put("qr_code_data", qr_code_data == null ? "" : qr_code_data);
        String s = new Gson().toJson(params);
        Log.e("新增门店 开店宝", s);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.incomeProfile, params, new ResponseObserver<BaseResponseBean>() {
            @Override
            public void onSuccessful(BaseResponseBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BaseResponseBean bean, String msg, String code) {
                callBack.onFailed(msg, code);
                ToastUtil.showShort(msg);
            }
        });
    }


    @Override
    public void isPreviously(String mobile, DataCallBack<BankListBean> callBack) {

        Map<String, Object> params = new HashMap<>();
        params.put("mobile", mobile == null ? "" : mobile);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.isPreviously, params, new ResponseObserver<BankListBean>() {
            @Override
            public void onSuccessful(BankListBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(BankListBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }

        });
    }
    @Override
    public void requestStoreShow(String id, DataCallBack<MerchantDetailsBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("id", id);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.StoreShow, params, new ResponseObserver<MerchantDetailsBean>() {
            @Override
            public void onSuccessful(MerchantDetailsBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(MerchantDetailsBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }
    @Override
    public void sendSignSms(String store_no, DataCallBack<SignContractBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("store_no", store_no);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.sendSignSms, params, new ResponseObserver<SignContractBean>() {
            @Override
            public void onSuccessful(SignContractBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(SignContractBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }
    @Override
    public void requestGetWxMercId(String store_no, String ys_merc_id ,DataCallBack<GetWxMercIdBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("store_no", store_no);
        params.put("ys_merc_id", ys_merc_id);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.getWxMercId, params, new ResponseObserver<GetWxMercIdBean>() {
            @Override
            public void onSuccessful(GetWxMercIdBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(GetWxMercIdBean bean, String msg, String code) {
                ToastUtil.showShort(msg);
            }
        });
    }
    @Override
    public void requestGetAgentType(String qr_code_data, DataCallBack<ChannelTypeBean> callBack) {
        Map<String, Object> params = new HashMap<>();
        params.put("qr_code_data", qr_code_data);
        RetrofitHelper.getInstance().request(MethodType.POST, URLConst.getAgentType, params, new ResponseObserver<ChannelTypeBean>() {
            @Override
            public void onSuccessful(ChannelTypeBean bean, String msg) {
                callBack.onSuccessful(bean);
            }

            @Override
            public void onFailure(ChannelTypeBean bean, String msg, String code) {
                callBack.onFailed(msg, code);
                ToastUtil.showShort(msg);
            }
        });
    }
}
